- Fire up your notebooks!
- Download (or clone) the course materials: https://umatter.github.io/courses
04/09/2020
| Thomas Aeschbacher | Jan Serwart | Ulrich Matter |
| (TA) | (JS) | (UM) |
library(ctv) available.views()
## ## CRAN Task Views ## --------------- ## Name: Bayesian ## Topic: Bayesian Inference ## Maintainer: Jong Hee Park ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ChemPhys ## Topic: Chemometrics and Computational Physics ## Maintainer: Katharine Mullen ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ClinicalTrials ## Topic: Clinical Trial Design, Monitoring, and Analysis ## Maintainer: Ed Zhang, Harry G. Zhang ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Cluster ## Topic: Cluster Analysis & Finite Mixture Models ## Maintainer: Friedrich Leisch, Bettina Gruen ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Databases ## Topic: Databases with R ## Maintainer: Yuan Tang ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: DifferentialEquations ## Topic: Differential Equations ## Maintainer: Karline Soetaert, Thomas Petzoldt ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Distributions ## Topic: Probability Distributions ## Maintainer: Christophe Dutang, Patrice Kiener ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Econometrics ## Topic: Econometrics ## Maintainer: Achim Zeileis ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Environmetrics ## Topic: Analysis of Ecological and Environmental Data ## Maintainer: Gavin Simpson ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ExperimentalDesign ## Topic: Design of Experiments (DoE) & Analysis of Experimental Data ## Maintainer: Ulrike Groemping ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ExtremeValue ## Topic: Extreme Value Analysis ## Maintainer: Christophe Dutang, Kevin Jaunatre ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Finance ## Topic: Empirical Finance ## Maintainer: Dirk Eddelbuettel ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: FunctionalData ## Topic: Functional Data Analysis ## Maintainer: Fabian Scheipl ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Genetics ## Topic: Statistical Genetics ## Maintainer: Giovanni Montana ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Graphics ## Topic: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization ## Maintainer: Nicholas Lewin-Koh ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: HighPerformanceComputing ## Topic: High-Performance and Parallel Computing with R ## Maintainer: Dirk Eddelbuettel ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Hydrology ## Topic: Hydrological Data and Modeling ## Maintainer: Sam Zipper, Sam Albers, Ilaria Prosdocimi ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: MachineLearning ## Topic: Machine Learning & Statistical Learning ## Maintainer: Torsten Hothorn ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: MedicalImaging ## Topic: Medical Image Analysis ## Maintainer: Brandon Whitcher ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: MetaAnalysis ## Topic: Meta-Analysis ## Maintainer: Michael Dewey ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: MissingData ## Topic: Missing Data ## Maintainer: Julie Josse, Nicholas Tierney, Nathalie Vialaneix (r-miss-tastic team) ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ModelDeployment ## Topic: Model Deployment with R ## Maintainer: Yuan Tang ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Multivariate ## Topic: Multivariate Statistics ## Maintainer: Paul Hewson ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: NaturalLanguageProcessing ## Topic: Natural Language Processing ## Maintainer: Fridolin Wild, Performance Augmentation Lab (PAL), Oxford Brookes University, UK ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: NumericalMathematics ## Topic: Numerical Mathematics ## Maintainer: Hans W. Borchers ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: OfficialStatistics ## Topic: Official Statistics & Survey Methodology ## Maintainer: Matthias Templ ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Optimization ## Topic: Optimization and Mathematical Programming ## Maintainer: Stefan Theussl, Florian Schwendinger, Hans W. Borchers ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Pharmacokinetics ## Topic: Analysis of Pharmacokinetic Data ## Maintainer: Bill Denney ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Phylogenetics ## Topic: Phylogenetics, Especially Comparative Methods ## Maintainer: Brian O'Meara ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Psychometrics ## Topic: Psychometric Models and Methods ## Maintainer: Patrick Mair ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: ReproducibleResearch ## Topic: Reproducible Research ## Maintainer: John Blischak, Alison Hill ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Robust ## Topic: Robust Statistical Methods ## Maintainer: Martin Maechler ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: SocialSciences ## Topic: Statistics for the Social Sciences ## Maintainer: John Fox ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Spatial ## Topic: Analysis of Spatial Data ## Maintainer: Roger Bivand ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: SpatioTemporal ## Topic: Handling and Analyzing Spatio-Temporal Data ## Maintainer: Edzer Pebesma ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Survival ## Topic: Survival Analysis ## Maintainer: Arthur Allignol, Aurelien Latouche ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: TeachingStatistics ## Topic: Teaching Statistics ## Maintainer: Paul Northrop ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: TimeSeries ## Topic: Time Series Analysis ## Maintainer: Rob J Hyndman ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: Tracking ## Topic: Processing and Analysis of Tracking Data ## Maintainer: Rocío Joo, Matthew E. Boone, Michael ## Sumner and Mathieu Basille ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: WebTechnologies ## Topic: Web Technologies and Services ## Maintainer: Scott Chamberlain, Thomas Leeper, Patrick Mair, Karthik Ram, Christopher Gandrud ## Repository: http://cran.rstudio.com/ ## --------------- ## Name: gR ## Topic: gRaphical Models in R ## Maintainer: Soren Hojsgaard ## Repository: http://cran.rstudio.com/
Install R from here!
Install RStudio from here!
Open RStudio and get familiar with the file browser pane on the lower right. Navigate to a folder on your hard disk in which you want to work throughout this course (and store all the code you write in this course).
Use the ‘New Folder’-button to create a new folder. Name this new folder r_course.
You should see the new folder listed in the file browser. Click on it to navigate to its contents (so far empty). Now, click on the ‘More’ button and select ‘Set as Working Directory’ in the drop-down menu.
Again, use the ‘New Folder’-button in order to create two new folders called data and code.
Finally, click on the project button in the top-right corner of the RStudio window () and select ‘New Project’ in the drop-down menu. In the pop-up window, select ‘Existing directory’, browse to and select your
r_course folder, then click ‘Create Project’.
Now you know how to set up a meaningful basic folder structure and working environment for an R project. The next exercise teaches you how to write R scripts in this environment.
print("Hello world")
You should see the words "Hello world" printed on screen. This is the usual way of working with R in an interactive session. However, as pointed out above, in most circumstances it makes sense to write the R code to an R script (in order to store and document it) and then execute the code from there.
In the RStudio Menu-bar select File/New File/R Script to create a new file, shown/opened in the Script pane.
Type print("Hello world") to the first line of the script, and click on ‘Run’ () to execute the code in the console.